#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(ui->pushButton,&QPushButton::clicked,this,&Widget::handleClicked);
}

void Widget::handleClicked()
{
    this->setWindowTitle("cf");
    qDebug() << "handleclick1";
}

void Widget::handleClicked2()
{
    this->setWindowTitle("fk");
    qDebug() << "handleclick2";
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_2_clicked()
{
    //先断开 再重新绑定
    disconnect(ui->pushButton,&QPushButton::clicked,this,&Widget::handleClicked);


    connect(ui->pushButton,&QPushButton::clicked,this,&Widget::handleClicked2);
}

void Widget::on_pushButton_clicked()
{

}
